Every day, millions of bytes of data are transferred between computers over networks such as the Internet. The data can comprise, for example, web pages, advertisements, music files, e-mail messages, and documents. The data is sent using a communications protocol such as Fiber Channel Protocol (FCP), Synchronous Optical Network (SONET), Transmission Control Protocol/Internet Protocol (TCP/IP), or the like. Using TCP/IP to illustrate the general function of communications protocols, TCP is used to establish and maintain a connection at both the source and destination computers, while IP serves to route the data between one or more networks to the destination computer. As a result, a computer on a first network can have a connection with a computer on a second network, and the networks can be connected via one or more additional networks, as is commonly done with communications over the Internet.
Once a TCP connection is established, a maximum packet size is negotiated between the source and destination computers. While TCP can support packets up to sixty-four kilobytes, the size may be limited by the underlying network. For example, an Ethernet network provides for a maximum of 1,518 bytes per message. In any event, data is packaged into one or more TCP “segments” for communication, wherein each segment is less than or equal to the maximum packet size. Each segment is then further packaged by the IP protocol and/or the underlying network (e.g., Ethernet) before being sent as a message. As part of the packaging process, each protocol (e.g., TCP, IP), and the network (e.g., Ethernet) may add required information to the data in a corresponding “header.” The header information is then used by the protocol/network to appropriately route the message, check for errors, reconstruct the data, etc.
For example, a source computer may desire to send a file having three kilobytes of data to a destination computer using TCP/IP over an Ethernet network. Initially, the data for the file could be packaged into three TCP segments. Each TCP segment would be further packaged by the IP protocol and the Ethernet network before being sent as a message to the destination computer. As a result, the message would include an Ethernet header, an IP header, a TCP header, and the data. The information in the Ethernet header is used to correctly route each message to the destination computer. Upon arrival at the destination computer, each message is unpackaged and the TCP and IP header information in each message is used to reassemble the data to recreate the file at the destination computer.
Once established, the TCP connection between the source computer and destination computer remains open until the data transfer is complete. A TCP connection for transferring a small amount of data is considered to be a “short lived” connection, while a TCP connection for transferring a large amount of data is considered to be a “long lived” connection. A computer sending/receiving data over a network such as the Internet may be simultaneously processing messages for tens (e.g., an end user computer) or hundreds or even thousands (e.g., a server) of TCP connections simultaneously. In order to match each message received with the appropriate TCP connection, the computer maintains information on each TCP connection in an entry in a “connection table.” Consequently, upon receipt of a message, the computer matches information in the TCP header with the appropriate connection table entry. When a match is found, the data is forwarded for further processing by the appropriate application.
The amount of time required to match a TCP connection with a received message can be critical to the overall performance of the computer. In general, a computer frequently includes a cache memory in order to speed up access to portions of a memory such as the connection table. In cache memory, a “least recently used” (LRU) algorithm is typically used to determine what data is to be swapped out of the cache memory when the cache memory is full. In the LRU algorithm, the data in the cache that has gone the longest without being accessed is selected to be swapped out. The LRU algorithm works well for most programs, which often access a block of data several times in a short duration, before not accessing the block of data for an extended period of time.
Since a connection table may be frequently accessed during communications, all or some of the connection table may be stored in cache memory. However, when selecting cache data to swap out, the LRU algorithm may not select the data that would be ideally removed. For example, due to the routing of messages, a long lived connection may have a large amount of time between messages. As a result, connection data for a long lived connection may be selected for removal in favor of data for more recently used, short lived connections. However, since the long lived connection will be used more frequently over time, it may be more efficient to leave the long lived connection data in the cache memory.
As a result, there exists a need for an improved method, system, and program product for managing connection information that determines an expected usage of a connection and stores the connection information in memory based on the expected usage.